package com.xuzhijie.pms.config.interceptor;

import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class ErrorInterceptor implements HandlerInterceptor {
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
            throws Exception {
        // 检查请求路径是否是 /error，如果是则返回 false 表示拦截
        if (request.getRequestURI().equals("/error")) {
            return false;
        }
        // 其他情况放行
        return true;
    }
}
